package tjcu.archives.mapper;

import org.apache.ibatis.annotations.Param;
import tjcu.archives.entity.Menu;
import tjcu.archives.entity.MenuExample;
import tjcu.archives.entity.User;

import java.util.List;

public interface MenuMapper {
    long countByExample(MenuExample example);

    int deleteByExample(MenuExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Menu record);

    int insertSelective(Menu record);

    List<Menu> selectByExample(MenuExample example);

    Menu selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Menu record, @Param("example") MenuExample example);

    int updateByExample(@Param("record") Menu record, @Param("example") MenuExample example);

    int updateByPrimaryKeySelective(Menu record);

    int updateByPrimaryKey(Menu record);

    User loginname(String loginname);

    //查询所有菜单
    List<Menu> queryMenuByUid(Integer userid);

    List<Menu> loadAvailableMenu();

    List<Menu> selAllMenuByUser(Integer userId);

    //查询所有菜单   模糊查询
    List<Menu> queryMenuAllList(Menu menu);


    //检查父级中是否有子级菜单
    int checkMenuHasChildren(Integer pid);

    List<Menu> queryMenuByRoleId(Integer roleid);
}